//
//  RXCarGroups.m
//  UITableViewDemo
//
//  Created by Ruoxin on 17/3/13.
//  Copyright © 2017年 Ruoxin. All rights reserved.
//

#import "RXCarGroups.h"
#import "RXCars.h"

@implementation RXCarGroups

+ (instancetype )carGroupsWithDict:(NSDictionary *)dict {
    RXCarGroups *group = [[self alloc] init];
    group.headTitle = dict[@"header"];
    group.footTitle = dict[@"footer"];
    
    // 字典数组-> 模型数组
    NSMutableArray *tempArr = [NSMutableArray new];
    for (NSDictionary *carDict in dict[@"cars"]) {
        RXCars *cars = [RXCars carsWithDict:carDict];
        [tempArr addObject:cars];
    }
    group.car = tempArr;
    
    return group;
}

@end
